package com.wanmait.hr.controller;

import com.wanmait.hr.util.TimestampEditor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.InitBinder;

import java.sql.Timestamp;


@ControllerAdvice
@Controller
public class BaseController //全局处理异常解析器
{
    @InitBinder //处理时间格式
    public  void init(WebDataBinder binder)
    {
        binder.registerCustomEditor(Timestamp.class,new TimestampEditor("yyyy-MM-dd"));
    }
}
